﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace GroupBuy.Util
{
	public class Utils
	{
		/// <summary>
		/// Encode password into MD5
		/// </summary>
		/// <param name="password">password to be encoded</param>
		/// <returns>MD5 code</returns>
		public static string EncodeMD5(string password)
		{
			byte[] s = new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(password));
			return BitConverter.ToString(s).Replace("-", "");
		}
	}
}